<%-- 
    Document   : ListarMisReservas
    Created on : 24/07/2008, 05:30:01 PM
    Author     : Alejandro
--%>

<%@ page language="java" import="java.util.*" %>
<%@ page language="java" import="com.akcess.vo.*" %>
<%@ page language="java" import="com.akcess.impl.*" %>
<%@ page language="java" import="java.sql.*" %>
<%@ page language="java" import="manejadores.*" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
            String path = request.getContextPath();
            String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head>
        <!--  Version: Multiflex-3.12 / Overview                    --><!--  Date:    January 20, 2008                             --><!--  Design:  www.1234.info                                --><!--  License: Fully open source without restrictions.      --><!--           Please keep footer credits with the words    --><!--           "Design by 1234.info" Thank you!             -->
        <script language="JavaScript">	
            <!--            
            function nuevoAjax(){
                var xmlhttp=false;
                try {
                    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
                } catch (e) {
                    try {
                        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                    } catch (E) {
                        xmlhttp = false;
                    }
                }
        
                if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
                    xmlhttp = new XMLHttpRequest();
                }
                return xmlhttp;
            } 
            function cargarContenido(){
                var cadena,t1,contenedor;
                contenedor = document.getElementById('ListaSolicitudes');
                t1 = document.getElementById('TipoSolicitud').value;
                if(t1!="#")
                {
                    ajax=nuevoAjax();
                    ajax.open("GET", "GestionarReservas?hacer=ListarMis&id="+t1,true);
                    ajax.onreadystatechange=function() {
                        if (ajax.readyState==4) {
                            cadena=ajax.responseText                        
                            contenedor.innerHTML = cadena
                        }
                    }
                    ajax.send(null)
                }
            } 
        
            //-->
        </script>
        
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="3600">
        <meta name="revisit-after" content="2 days">
        <meta name="robots" content="index,follow">
        <meta name="publisher" content="Your publisher infos here ...">
        <meta name="copyright" content="Your copyright infos here ...">
        <meta name="author" content="Design: 1234.info / Modified: Your Name">
        <meta name="distribution" content="global">
        <meta name="description" content="Your page description here ...">
        <meta name="keywords" content="Your keywords, keywords, keywords, here ...">
        <base href="<%=basePath%>">
        <link rel="stylesheet" type="text/css" media="screen,projection,print" href="./css/layout4_setup.css">
        <link rel="stylesheet" type="text/css" media="screen,projection,print" href="./css/layout4_text.css">
    <link rel="icon" type="image/x-icon" href="./img/favicon.ico"><title>SRR - Sistema de Reserva de Recursos</title><!-- Global IE fix to avoid layout crash when single word size wider than column width --><!--[if IE]><style type="text/css"> body {word-wrap: break-word;}</style><![endif]--><link href="./css/highlighter.css" type="text/css" rel="stylesheet"><link href="./css/highlighter_002.css" type="text/css" rel="stylesheet"></head><body>
        <!-- Main Page Container -->
        <div class="page-container">
            
            <!-- For alternative headers START PASTE here -->

    <!-- A. HEADER -->      
            <jsp:include page="../Header.jsp"/>
            
            <!-- For alternative headers END PASTE here -->

            <!-- B. MAIN -->
            <div class="main">
                
                <!-- B.1 MAIN NAVIGATION -->
                <jsp:include page="../barraOperaciones.jsp"/> 
                
                <!-- B.2 MAIN CONTENT -->
                <div class="main-content">
                    
                    <!-- Pagetitle -->
                    <h1 class="pagetitle">Mis Reservas</h1>
                    
                    <table border="1">
                    <tbody>
                    
                    <%
            Connection con = (Connection) session.getAttribute("conexion");
            Tipo_recursoDAOImpl tiposR = new Tipo_recursoDAOImpl();
            Tipo_recurso[] vecTipos = tiposR.findAll(con);

            out.println("<table border=\"0\">");
            out.println("<tbody>");
            out.println("<tr>");
            out.println("<td><center>");
            out.println("<select id=TipoSolicitud onchange=\"cargarContenido()\">");
            out.println("<option value=\"#\"> [Seleccione una opcion...]");
            out.println("<option value=Aula>Aulas");
            out.println("<option value=Sala>Sala de Maquinas");
            if (vecTipos.length != 0) {

                for (int j = 0; j < vecTipos.length; j++) {
                    out.println("<option value=" + vecTipos[j].getId_tipo_recurso() + "> " + vecTipos[j].getNombre());
                }

            }
            out.println("</center></td>");
            out.println("</tr>");
            out.println("</tbody>");
            out.println("</table>");

                    %>
                    
                    <div id="ListaSolicitudes">
                         <%
                    String error = (String) request.getAttribute("Error");
                    if (error != null) {
                        out.println("<br><p><FONT FACE=\"arial\" SIZE=1 COLOR=red>" + error + "</FONT></p>");
                    }
                    %>
                    </div>                   
                    
                </div>               
                <!-- B.3 SUBCONTENT -->                
            </div>
            <!-- C. FOOTER AREA -->   
            <%@include file="../footer.jsp"%>          
        </div>         
    </body>
</html>
